package com.bjtu.transactionclient.dao;

import com.bjtu.transactionclient.domain.UserIndexNoTable;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("UserIndexDao")

public interface UserIndexDao {

	void addUserIndexNoTable(UserIndexNoTable userIndexNo);

	@Select("select * from userindexnotable where IndexNo = #{index}")
	UserIndexNoTable queryUserIndexNoByIndex(@Param("index") String index);

	// 使用需要 UserIndexDao.queryUserIndexNoLike(indexPrefix + "%")
	@Select("select IndexNo from userindexnotable where IndexNo Like  #{indexPrefix} ")
	List<String>  queryUserIndexNoLike(@Param("indexPrefix") String indexPrefix);

	@Select("select * from userindexnotable where UserNo = #{userNo} and Stamp > #{date}")
	List<UserIndexNoTable> queryUserIndexNoByUserNo(@Param("userNo")String userNo, @Param("date")String date);

}
